//
//  LXYearCheckTableViewCell.m
//  ZuLinProject
//
//  Created by bancheng on 2022/9/5.
//  Copyright © 2022 LX_App. All rights reserved.
//

#import "LXYearCheckTableViewCell.h"
#import "LXYearCheckModel.h"
#import "CheLiangModel.h"
#import "LXDepositModel.h"
@implementation LXYearCheckTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self.backView addCorner:4];
    
}


- (void)setModel:(LXYearCheckModel *)model{
    model = model;
    
    self.label1.text = model.carNum;
    
    self.label2.text = [NSString stringWithFormat:@"负责人  %@",[NSString stringWithNull:model.chargeName]];
    [self.label2 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"负责人"];
    
    self.label3.text = [NSString stringWithFormat:@"年检时间  %@",[NSString stringWithNull:model.currentInspectTime]];
    [self.label3 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"年检时间"];
    
    self.label4.text = [NSString stringWithFormat:@"下次年检  %@",[NSString stringWithNull:model.nextInspectTime]];
    [self.label4 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"下次年检"];
    
    
    self.label5.text = [NSString stringWithFormat:@"备      注     %@",[NSString stringWithNull:model.remark]];
    [self.label5 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"备      注"];
    
    self.label6.text = [NSString stringWithFormat:@"应付金额  %@",[NSString toTen:model.amount]];
    [self.label6 addAttributes:TextAttrCorlor(ColorWithFF921C) forText:[NSString toTen:model.amount] size:[UIFont systemFontOfSize:20 weight:UIFontWeightSemibold]];
    if ([model.paidAmount intValue]>0) {
        self.label7.text = [NSString stringWithFormat:@"实付金额  %@",[NSString toTen:model.paidAmount]];
        [self.label7 addAttributes:TextAttrCorlor(ColorWithFF921C) forText:[NSString toTen:model.paidAmount] size:[UIFont systemFontOfSize:20 weight:UIFontWeightSemibold]];

    }
    else {
        self.label7.text = @"实付金额  --";
        [self.label7 addAttributes:TextAttrCorlor(Color333) forText:@"--" size:[UIFont systemFontOfSize:20 weight:UIFontWeightSemibold]];
    }


    
}
- (void)setSfkModel:(CheLiangModel *)sfkModel{
    _sfkModel = sfkModel;
    
    self.label1.text = [NSString stringWithNull:sfkModel.carNumber];
    
    NSString *nameStr = @"";
    if (sfkModel.customerType == 0) {
        nameStr = @"客户姓名";
    }
    else {
        nameStr = @"合作伙伴";
    }
    self.label2.text = [NSString stringWithFormat:@"%@  %@",nameStr,[NSString stringWithNull:sfkModel.customerName]];

    [self.label2 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:nameStr];
    
    
    // 付款
    if ([sfkModel.amountType isEqualToString:@"out"]) {
        
      
        self.label3.text = [NSString stringWithFormat:@"应付日期  %@",[NSString stringWithNull:sfkModel.exceptDate]];
        [self.label3 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"应付日期"];
        
        self.label4.text = [NSString stringWithFormat:@"实付日期  %@",[NSString stringWithNull:sfkModel.realDate]];
        [self.label4 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"实付日期"];
        
        self.label6.text = [NSString stringWithFormat:@"应付金额   %@",[NSString toTen:sfkModel.amount]];
        [self.label6 addAttributesArray:@[TextAttrCorlor(ColorWithAAAAAA),TextAttrCorlor(ColorWithFF921C)] forStringArray:@[@"应付金额",[NSString toTen:sfkModel.amount]] size:13];
        
        self.label7.text = [NSString stringWithFormat:@"实付金额   %@", [NSString toTen:sfkModel.realAmount]];
        [self.label7 addAttributesArray:@[TextAttrCorlor(ColorWithAAAAAA),TextAttrCorlor(ColorWithFF921C)] forStringArray:@[@"实付金额",[NSString toTen:sfkModel.realAmount]] size:13];
       
        self.label8.textColor = ColorWith3C6CFC;
        self.label8.text = [NSString getPaidNameWithFundType:sfkModel.fundType];

    }
    else {
        
      
        
        self.label3.text = [NSString stringWithFormat:@"应收日期  %@",[NSString stringWithNull:sfkModel.exceptDate]];
        [self.label3 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"应收日期"];
        
        self.label4.text = [NSString stringWithFormat:@"实收日期  %@",[NSString stringWithNull:sfkModel.realDate]];
        [self.label4 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"实收日期"];

        self.label6.text = [NSString stringWithFormat:@"应收金额   %@",[NSString toTen:sfkModel.amount]];
        [self.label6 addAttributesArray:@[TextAttrCorlor(ColorWithAAAAAA),TextAttrCorlor(ColorWithFF921C)] forStringArray:@[@"应收金额",[NSString toTen:sfkModel.amount]] size:13];
        
        
        self.label7.text = [NSString stringWithFormat:@"实收金额   %@", [NSString toTen:sfkModel.realAmount]];
        [self.label7 addAttributesArray:@[TextAttrCorlor(ColorWithAAAAAA),TextAttrCorlor(ColorWithFF921C)] forStringArray:@[@"实收金额",[NSString toTen:sfkModel.realAmount]] size:13];
        self.label8.textColor = ColorWith3C6CFC;
        self.label8.text = [NSString getCollectionNameWithFundType:sfkModel.fundType];

        
    }
    
   
    
    self.label5.text = [NSString stringWithFormat:@"备注   %@",[NSString stringWithNull:sfkModel.remark]];
    [self.label5 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"备注"];

    
    
  
    
    self.label9.text = @"已支付";
    self.label9.textColor = ColorWith3C6CFC;
    self.label9.backgroundColor = [ColorWith3C6CFC colorWithAlphaComponent:0.1];
    
}

- (void)setYfkModel:(CheLiangModel *)yfkModel{
    _yfkModel = yfkModel;
    
    self.label1.text = [NSString stringWithNull:yfkModel.carNumber];
    
    
    NSString *nameStr = @"";
    if (yfkModel.payeeType == 0) {
        nameStr = @"客户姓名";
    }
    else {
        nameStr = @"合作伙伴";
    }
    
    if (!StringIsEmpty(yfkModel.payeeName)) {
        self.label2.text = [NSString stringWithFormat:@"%@  %@",nameStr,yfkModel.payeeName];
    }
    else {
        self.label2.text = [NSString stringWithFormat:@"%@  %@",nameStr,[NSString stringWithNull:yfkModel.customerName]];
    }
    [self.label2 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:nameStr];
    
    self.label3.text = [NSString stringWithFormat:@"应付日期  %@",[NSString stringWithNull:yfkModel.exceptPaidDate]];
    [self.label3 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"应付日期"];
    
    
    self.label5.text = [NSString stringWithFormat:@"备注   %@",[NSString stringWithNull:yfkModel.remark]];
    [self.label5 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"备注"];

    
    

    self.label6.text = [NSString stringWithFormat:@"应付金额   %@",[NSString toTen:yfkModel.amount]];
    [self.label6 addAttributesArray:@[TextAttrCorlor(ColorWithAAAAAA),TextAttrCorlor(ColorWithFF921C)] forStringArray:@[@"应付金额",[NSString toTen:yfkModel.amount]] size:13];
    
    
    if ([yfkModel.paidAmount doubleValue]==0) {
        self.label7.text = @"实付金额  -";
        [self.label7 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"实付金额"];
        
        self.label4.text = [NSString stringWithFormat:@"实付日期  -"];
        [self.label4 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"实付日期"];

    }
    else {
        
        self.label4.text = [NSString stringWithFormat:@"实付日期  %@",[NSString stringWithNull:yfkModel.paidDate]];
        [self.label4 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"实付日期"];

        
        self.label7.text = [NSString stringWithFormat:@"实付金额   %@", [NSString toTen:yfkModel.paidAmount]];
        [self.label7 addAttributesArray:@[TextAttrCorlor(ColorWithAAAAAA),TextAttrCorlor(ColorWithFF921C)] forStringArray:@[@"实付金额",[NSString toTen:yfkModel.paidAmount]] size:13];
    }
    
    
    
    
    
    
    self.label8.textColor = ColorWith3C6CFC;
    
    self.label8.text = [NSString getPaidNameWithFundType:yfkModel.fundType];

    
    if (yfkModel.settleState == 0) {
        self.label9.text = @"未付清";
        self.label9.textColor = ColorWithEA545A;
        self.label9.backgroundColor = [ColorWithEA545A colorWithAlphaComponent:0.1];
    }
    else {
        self.label9.text = @"已付清";
        self.label9.textColor = ColorWith3C6CFC;
        self.label9.backgroundColor = [ColorWith3C6CFC colorWithAlphaComponent:0.1];
    }
    
    
    
    
}

- (void)setYskModel:(CheLiangModel *)yskModel{
    _yskModel = yskModel;
    
    
    self.label1.text = [NSString stringWithNull:yskModel.carNumber];
    
    NSString *nameStr = @"";
    if (yskModel.payerType == 0) {
        nameStr = @"客户姓名";
    }
    else {
        nameStr = @"合作伙伴";
    }
    
    if (!StringIsEmpty(yskModel.payerName)) {
        self.label2.text = [NSString stringWithFormat:@"%@  %@",nameStr,yskModel.payerName];
    }
    else {
        self.label2.text = [NSString stringWithFormat:@"%@  %@",nameStr,[NSString stringWithNull:yskModel.customerName]];
    }
    [self.label2 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:nameStr];
    
    self.label3.text = [NSString stringWithFormat:@"应收日期  %@",[NSString stringWithNull:yskModel.exceptReceiveDate]];
    [self.label3 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"应收日期"];
    
    
    self.label5.text = [NSString stringWithFormat:@"备注   %@",[NSString stringWithNull:yskModel.remark]];
    [self.label5 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"备注"];

    
    

    self.label6.text = [NSString stringWithFormat:@"应收金额   %@",[NSString toTen:yskModel.amount]];
    [self.label6 addAttributesArray:@[TextAttrCorlor(ColorWithAAAAAA),TextAttrCorlor(ColorWithFF921C)] forStringArray:@[@"应收金额",[NSString toTen:yskModel.amount]] size:13];
    
    
    if ([yskModel.receiveAmount doubleValue]==0) {
        
        self.label4.text = [NSString stringWithFormat:@"实收日期  -"];
        self.label4.textColor = ColorWithAAAAAA;

        
        self.label7.text = @"实收金额  -";
        [self.label7 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"实收金额"];

    }
    else {
        
        
        self.label4.text = [NSString stringWithFormat:@"实收日期  %@",yskModel.receiveDate];
        self.label4.textColor = ColorWith333333;
        [self.label4 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"实收日期"];

        
        self.label7.text = [NSString stringWithFormat:@"实收金额   %@", [NSString toTen:yskModel.receiveAmount]];
        [self.label7 addAttributesArray:@[TextAttrCorlor(ColorWithAAAAAA),TextAttrCorlor(ColorWithFF921C)] forStringArray:@[@"实收金额",[NSString toTen:yskModel.receiveAmount]] size:13];
    }
    
    
    
    
    
    
    self.label8.textColor = ColorWith3C6CFC;
    
    self.label8.text = [NSString getCollectionNameWithFundType:yskModel.fundType];
    
   
    if (yskModel.settleState == 0) {
        self.label9.text = @"未结清";
        self.label9.textColor = ColorWithEA545A;
        self.label9.backgroundColor = [ColorWithEA545A colorWithAlphaComponent:0.1];
    }
    else {
        self.label9.text = @"已结清";
        self.label9.textColor = ColorWith3C6CFC;
        self.label9.backgroundColor = [ColorWith3C6CFC colorWithAlphaComponent:0.1];
    }
    
}

- (void)setDepositModel:(LXDepositModel *)depositModel{
    _depositModel = depositModel;
    
    self.label1.text = [NSString stringWithNull:depositModel.carNumber];
    
    
    
    self.label2.text = [NSString stringWithFormat:@"客户姓名  %@",[NSString stringWithNull:depositModel.payeeName]];
    [self.label2 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"客户姓名"];
    
    self.label3.text = [NSString stringWithFormat:@"应付日期  %@",[NSString stringWithNull:depositModel.exceptPaidDate]];
    [self.label3 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"应付日期"];
    
    
    self.label5.text = [NSString stringWithFormat:@"备注   %@",[NSString stringWithNull:depositModel.remark]];
    [self.label5 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"备注"];

    
    if ([depositModel.paidAmount doubleValue] == 0) {
        self.label8.text = @"未支付";
        self.label8.textColor = ColorWithEA545A;
        self.label8.backgroundColor = [ColorWithEA545A colorWithAlphaComponent:0.1];
    }
    else {
        self.label8.text = @"已支付";
        self.label8.textColor = ColorWith3C6CFC;
        self.label8.backgroundColor = [ColorWith3C6CFC colorWithAlphaComponent:0.1];
    }

    self.label6.text = [NSString stringWithFormat:@"应付金额   %@",[NSString toTen:depositModel.amount]];
    [self.label6 addAttributesArray:@[TextAttrCorlor(ColorWithAAAAAA),TextAttrCorlor(ColorWithFF921C)] forStringArray:@[@"应付金额",[NSString toTen:depositModel.amount]] size:13];
    
    if ([depositModel.paidAmount doubleValue]==0) {
        
        self.label4.text = [NSString stringWithFormat:@"实付日期  -"];
        self.label4.textColor = ColorWithAAAAAA;

        
        self.label7.text = @"实付金额  --";
        [self.label7 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forString:@"实付金额"];

    }
    else {
        
//        self.label4.textColor = ColorWith333333;
        self.label4.text = [NSString stringWithFormat:@"实付日期  %@",[NSString stringWithNull:depositModel.paidDate]];
        [self.label4 addAttributes:TextAttrCorlor(ColorWith333333) forString:[NSString stringWithNull:depositModel.paidDate]];

        
        self.label7.text = [NSString stringWithFormat:@"实付金额 %@", [NSString toTen:depositModel.paidAmount]];
        [self.label7 addAttributesArray:@[TextAttrCorlor(ColorWithAAAAAA),TextAttrCorlor(ColorWithFF921C)] forStringArray:@[@"实付金额",[NSString toTen:depositModel.paidAmount]] size:13];
        
        
    }
    


}
@end
